
package system.base;

//import com.v3.sys.SysConfig;

import framework.core.*;

/*
	Author    :Sindy
	CreateTime:2008-02-13 12:20:35
*/
public class ProductCategorySearchEvent extends SearchEvent
{

	private String m_id = "" ; // all

	private String m_code = "" ; // all

	private String m_name = "" ; // all

	private String m_remark = "" ; // all

	private String m_category_level = "" ; // all

	private String m_upper_category = "" ; // all

	private String m_is_tradeflat_category = "" ; // all

	private String m_category_id1 = "" ; // all

	private String m_category_id2 = "" ; // all

	private String m_status = "" ; // all

	private String m_create_user_id = "" ; // all

	private String m_create_user = "" ; // all

	private String m_create_time = "" ; // all

	private String m_last_update_user_id = "" ; // all

	private String m_last_update_user = "" ; // all

	private String m_last_update_time = "" ; // all

	private String m_grandfather_category = "";

public ProductCategorySearchEvent() 
{
	super();
	
	setOrderField(ProductCategory.ID);
		
}



	public String getId()
	{
		return m_id ;
	}
	public void setId(String v)
	{
		m_id = v;
	}

	public String getCode()
	{
		return m_code ;
	}
	public void setCode(String v)
	{
		m_code = v;
	}

	public String getName()
	{
		return m_name ;
	}
	public void setName(String v)
	{
		m_name = v;
	}

	public String getRemark()
	{
		return m_remark ;
	}
	public void setRemark(String v)
	{
		m_remark = v;
	}

	public String getCategoryLevel()
	{
		return m_category_level ;
	}
	public void setCategoryLevel(String v)
	{
		m_category_level = v;
	}

	public String getUpperCategory()
	{
		return m_upper_category ;
	}
	public void setUpperCategory(String v)
	{
		m_upper_category = v;
	}

	public String getIsTradeflatCategory()
	{
		return m_is_tradeflat_category ;
	}
	public void setIsTradeflatCategory(String v)
	{
		m_is_tradeflat_category = v;
	}

	public String getCategoryId1()
	{
		return m_category_id1 ;
	}
	public void setCategoryId1(String v)
	{
		m_category_id1 = v;
	}

	public String getCategoryId2()
	{
		return m_category_id2 ;
	}
	public void setCategoryId2(String v)
	{
		m_category_id2 = v;
	}

	public String getStatus()
	{
		return m_status ;
	}
	public void setStatus(String v)
	{
		m_status = v;
	}

	public String getCreateUserId()
	{
		return m_create_user_id ;
	}
	public void setCreateUserId(String v)
	{
		m_create_user_id = v;
	}

	public String getCreateUser()
	{
		return m_create_user ;
	}
	public void setCreateUser(String v)
	{
		m_create_user = v;
	}

	public String getCreateTime()
	{
		return m_create_time ;
	}
	public void setCreateTime(String v)
	{
		m_create_time = v;
	}

	public String getLastUpdateUserId()
	{
		return m_last_update_user_id ;
	}
	public void setLastUpdateUserId(String v)
	{
		m_last_update_user_id = v;
	}

	public String getLastUpdateUser()
	{
		return m_last_update_user ;
	}
	public void setLastUpdateUser(String v)
	{
		m_last_update_user = v;
	}

	public String getLastUpdateTime()
	{
		return m_last_update_time ;
	}
	public void setLastUpdateTime(String v)
	{
		m_last_update_time = v;
	}
	
    public String getGrandfatherCategory()
    {
        return m_grandfather_category ;
    }
    public void setGrandfatherCategory(String v)
    {
        m_grandfather_category = v;
    }


	public String viewId() throws Exception
	{
		return Value.view(getId());
	}

	public String viewCode() throws Exception
	{
		return Value.view(getCode());
	}

	public String viewName() throws Exception
	{
		return Value.view(getName());
	}

	public String viewRemark() throws Exception
	{
		return Value.view(getRemark());
	}

	public String viewCategoryLevel() throws Exception
	{
		return Value.view(getCategoryLevel());
	}

    public String viewUpperCategory() throws Exception
    {
        return Value.view(getUpperCategory());
    }

	public String viewIsTradeflatCategory() throws Exception
	{
		return Value.view(getIsTradeflatCategory());
	}

	public String viewCategoryId1() throws Exception
	{
		return Value.view(getCategoryId1());
	}

	public String viewCategoryId2() throws Exception
	{
		return Value.view(getCategoryId2());
	}

	public String viewStatus() throws Exception
	{
		return Value.view(getStatus());
	}

	public String viewCreateUserId() throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser() throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime() throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewLastUpdateUserId() throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewLastUpdateUser() throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateTime() throws Exception
	{
		return Value.view(getLastUpdateTime());
	}

    public String viewGrandfatherCategory() throws Exception
    {
        return Value.view(getGrandfatherCategory());
    } 
    
	public Conditions toConditions() throws Exception
	{
		Conditions c = super.toConditions();

	c.add(getCondition(ProductCategory.ID,getId()));

	c.add(getCondition(ProductCategory.CODE,getCode()));

	c.add(getCondition(ProductCategory.NAME,getName()));

	c.add(getCondition(ProductCategory.REMARK,getRemark()));

	c.add(getCondition(ProductCategory.CATEGORY_LEVEL,getCategoryLevel()));

	c.add(getCondition(ProductCategory.UPPER_CATEGORY,getUpperCategory()));

	c.add(getCondition(ProductCategory.IS_TRADEFLAT_CATEGORY,getIsTradeflatCategory()));

	c.add(getCondition(ProductCategory.CATEGORY_ID1,getCategoryId1()));

	c.add(getCondition(ProductCategory.CATEGORY_ID2,getCategoryId2()));

	c.add(getCondition(ProductCategory.STATUS,getStatus()));

	c.add(getCondition(ProductCategory.CREATE_USER_ID,getCreateUserId()));

	c.add(getCondition(ProductCategory.CREATE_USER,getCreateUser()));

	c.add(getCondition(ProductCategory.CREATE_TIME,getCreateTime()));

	c.add(getCondition(ProductCategory.LAST_UPDATE_USER_ID,getLastUpdateUserId()));

	c.add(getCondition(ProductCategory.LAST_UPDATE_USER,getLastUpdateUser()));

	c.add(getCondition(ProductCategory.LAST_UPDATE_TIME,getLastUpdateTime()));

	if(!getGrandfatherCategory().equalsIgnoreCase("")){
	    if(!getUpperCategory().equalsIgnoreCase(""))
	        c.add("( UPPER_CATEGORY = '"+ getUpperCategory() +"' or CODE = '"+ getUpperCategory()+"') ");
	    else
	        c.add("( UPPER_CATEGORY = '"+ getGrandfatherCategory() +"' or CODE = '"+ getGrandfatherCategory()+"') ");
	}

			
		return c ;
	}
	
//add by Sindy start


	
	private String[] m_warehouse_codes = null;
	public String[] getWarehouseCodes()
    {
        return m_warehouse_codes ;
    }
    public void setWarehouseCodes(String[] v)
    {
        m_warehouse_codes = v;
    }   
	//add by chengbiao.he end
}
